import 'package:dependencies_examples/generated/json/base/json_convert_content.dart';
import 'package:dependencies_examples/serializable/flutterJsonBeanFactory/example_entity.dart';

ExampleEntity $ExampleEntityFromJson(Map<String, dynamic> json) {
  final ExampleEntity exampleEntity = ExampleEntity();
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    exampleEntity.name = name;
  }
  final bool? sex = jsonConvert.convert<bool>(json['sex']);
  if (sex != null) {
    exampleEntity.sex = sex;
  }
  final int? age = jsonConvert.convert<int>(json['age']);
  if (age != null) {
    exampleEntity.age = age;
  }
  return exampleEntity;
}

Map<String, dynamic> $ExampleEntityToJson(ExampleEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['name'] = entity.name;
  data['sex'] = entity.sex;
  data['age'] = entity.age;
  return data;
}

extension ExampleEntityExtension on ExampleEntity {
  ExampleEntity copyWith({
    String? name,
    bool? sex,
    int? age,
  }) {
    return ExampleEntity()
      ..name = name ?? this.name
      ..sex = sex ?? this.sex
      ..age = age ?? this.age;
  }
}